package com.my.zl.console.controller.visualEdit;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.my.zl.common.dto.ReqDTO;
import com.my.zl.common.dto.ResDTO;
import com.my.zl.common.dto.advancedQuery.PageQueryDTO;
import com.my.zl.console.common.aop.LogAnnotation;
import com.my.zl.console.controller.base.BaseController;
import com.my.zl.console.entity.visualEdit.ZlHtmlDesignDtl;
import com.my.zl.console.dto.visualEdit.htmlDesignDtl.ReqHtmlDesignDtlAddDTO;
import com.my.zl.console.dto.visualEdit.htmlDesignDtl.ReqHtmlDesignDtlDelDTO;
import com.my.zl.console.dto.visualEdit.htmlDesignDtl.ReqHtmlDesignDtlEditDTO;
import com.my.zl.console.dto.visualEdit.htmlDesignDtl.ReqHtmlDesignDtlQueryDTO;
import com.my.zl.console.dto.visualEdit.htmlDesignDtl.ReqHtmlDesignDtlDetailDTO;
import com.my.zl.console.dto.visualEdit.htmlDesignDtl.ReqHtmlDesignDtlStateDTO;
import com.my.zl.console.dto.visualEdit.htmlDesignDtl.ResHtmlDesignDtlAddDTO;
import com.my.zl.console.dto.visualEdit.htmlDesignDtl.ResHtmlDesignDtlDelDTO;
import com.my.zl.console.dto.visualEdit.htmlDesignDtl.ResHtmlDesignDtlEditDTO;
import com.my.zl.console.dto.visualEdit.htmlDesignDtl.ResHtmlDesignDtlQueryDTO;
import com.my.zl.console.dto.visualEdit.htmlDesignDtl.ResHtmlDesignDtlDetailDTO;
import com.my.zl.console.service.visualEdit.IHtmlDesignDtlService;
import com.my.zl.console.dto.visualEdit.htmlDesignDtl.ResHtmlDesignDtlStateDTO;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 在线页面明细
 * @author ZL
 */
@Api(value="在线页面明细",tags ="在线页面明细")
@RestController
@RequestMapping("/api/autocode/htmlDesignDtl")
public class HtmlDesignDtlController extends BaseController {

    @Autowired
    private IHtmlDesignDtlService htmlDesignDtlService;
    
    /**
     * 查询
     */
    @ApiOperation(value="在线页面明细-查询")
    @RequestMapping(value="/list", method = RequestMethod.GET)
    public ResDTO<ResHtmlDesignDtlQueryDTO> listHtmlDesignDtl(ReqHtmlDesignDtlQueryDTO reqInfo,PageQueryDTO page) throws Exception{
        ResHtmlDesignDtlQueryDTO data = htmlDesignDtlService.queryHtmlDesignDtlList(reqInfo,page);
        return successDATA(data);
    }
    
   /**
     * 详情
     */
    @ApiOperation(value="在线页面明细-详情")
    @RequestMapping(value="/detail", method = RequestMethod.GET)
    public ResDTO<ResHtmlDesignDtlDetailDTO> detailHtmlDesignDtl(ReqHtmlDesignDtlDetailDTO reqInfo) throws Exception{
        ResHtmlDesignDtlDetailDTO data = htmlDesignDtlService.queryHtmlDesignDtlDetail(reqInfo);
        return successDATA(data);
    }
    
    /**
     * 新增
     */
    @ApiOperation(value="在线页面明细-新增")
    @RequestMapping(value="/add", method = RequestMethod.POST)
    public ResDTO<ResHtmlDesignDtlAddDTO> addHtmlDesignDtl(@RequestBody ReqDTO<ReqHtmlDesignDtlAddDTO> reqInfo) throws Exception{
        ResHtmlDesignDtlAddDTO data = htmlDesignDtlService.insertHtmlDesignDtlInfo(reqInfo);
        return successDATA(data);
    }
    
    /**
     * 编辑
     */
    @ApiOperation(value="在线页面明细-编辑")
    @RequestMapping(value="/edit", method = RequestMethod.POST)
    public ResDTO<ResHtmlDesignDtlEditDTO> editHtmlDesignDtl(@RequestBody ReqDTO<ReqHtmlDesignDtlEditDTO> reqInfo) throws Exception{
        ResHtmlDesignDtlEditDTO data = htmlDesignDtlService.updateHtmlDesignDtlInfo(reqInfo);
        return successDATA(data);
    }
    
    /**
     * 删除
     */
    @ApiOperation(value="在线页面明细-删除")
    @RequestMapping(value="/del", method = RequestMethod.POST)
    public ResDTO<ResHtmlDesignDtlDelDTO> delHtmlDesignDtl(@RequestBody ReqDTO<ReqHtmlDesignDtlDelDTO> reqInfo) throws Exception{
        ResHtmlDesignDtlDelDTO data = htmlDesignDtlService.deleteHtmlDesignDtlInfo(reqInfo);
        return successDATA(data); 
    }
    
    /**
     * 状态更新
     */
    @ApiOperation(value="在线页面明细-状态更新")
    @RequestMapping(value="/state", method = RequestMethod.POST)
    public ResDTO<ResHtmlDesignDtlStateDTO> stateHtmlDesignDtl(@RequestBody ReqDTO<ReqHtmlDesignDtlStateDTO> reqInfo) throws Exception{
        ResHtmlDesignDtlStateDTO data = htmlDesignDtlService.updateHtmlDesignDtlState(reqInfo);
        return successDATA(data); 
    }
    
    
}